import request from "@/utils/request"

export default {
  // 列表
  query(data) {
    return request({
      baseURL: window.APP_GETEWAY.owpmc,
      url: `/v1/purchase-demand/promotion-demand/list`,
      method: "post",
      data,
    })
  },
  // 添加
  create(data) {
    return request({
      baseURL: window.APP_GETEWAY.owpmc,
      url: `/v1/purchase-demand/promotion-demand/create`,
      method: "post",
      data,
    })
  },
  // 编辑
  edit(data) {
    return request({
      baseURL: window.APP_GETEWAY.owpmc,
      url: `/v1/purchase-demand/promotion-demand/edit`,
      method: "post",
      data,
    })
  },
  // 明细
  detail(params) {
    return request({
      baseURL: window.APP_GETEWAY.owpmc,
      url: `/v1/purchase-demand/promotion-demand/detail`,
      method: "get",
      params,
    })
  },
  // 批量提交
  batchSubmit(data) {
    return request({
      baseURL: window.APP_GETEWAY.owpmc,
      url: `/v1/purchase-demand/promotion-demand/batch-submit`,
      method: "post",
      data,
    })
  },
  // 批量作废
  batchCancel(data) {
    return request({
      baseURL: window.APP_GETEWAY.owpmc,
      url: `/v1/purchase-demand/promotion-demand/batch-cancel`,
      method: "post",
      data,
    })
  },
  // 创建多平台发货计划
  applyDemand(data) {
    return request({
      baseURL: window.APP_GETEWAY.owpmc,
      url: `/v1/purchase-demand/promotion-demand/apply-demand`,
      method: "post",
      data,
      returnData: true,
    })
  },
  // 获取所有活动配置
  getPromotionConfig() {
    return request({
      baseURL: window.APP_GETEWAY.owpmc,
      url: `/v1/purchase-demand/promotion-config/get-promotion-config`,
      method: "get",
    })
  },
}
